package com.gill.exp.pojo.dos;

import com.gill.exp.common.validator.annotation.Gender;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.*;
import java.util.List;

@Data
@Builder
@Accessors(chain = true)
public class UserDO {

    private Long id;

    @NotNull(message ="column1不能为空")
    @Size(min = 3, max = 5, message = "column1长度为{min}-{max}之间")
    private String column1;

    @Null(message ="column2必须为空")
    private String column2;

    @NotBlank(message ="column3不能为空白字符串")
    private String column3;

    @Max(value = 10,message = "column4最大为10")
    @Min(value = 1,message = "column4最小为1")
    private String column4;

    @DecimalMax(value = "10",message = "column5最大为10")
    @DecimalMin(value = "1",message = "column5最小为1")
    private String column5;

    @NotEmpty(message = "column6集合不能为空")
    private List<String> column6;

    @Email(message = "column7必须为邮箱格式")
    private String column7;

    /**
     * 自定义检验规则注解
     */
    @Gender(message = "column8为男或女")
    private String column8;
}